Skip to content

Conversation

jsaizsantos
Copy link

@jsaizsantos jsaizsantos commented Oct 8, 2025

Dear Astroquery community:
This is my first PR to this repository. I am a developer working for the Euclid archive at ESAC.

The purpose of this PR is to add a new method get_datalinks_metadata to the Euclid class, to return additional columns on top of the ones returned by the plain get_datalinks method, which is left untouched as it complies with the IVOA standard.

The actual new columns to return are left to the datalinks service of the Euclid archive; currently it is datalabs_path, to be used for Datalabs, but two more will come in a new release of the archive (with no further required change on the Astroquery interface): file_name and hdu_index.

cc @esdc-esac-esa-int

Copy link

codecov bot commented Oct 8, 2025

Codecov Report

❌ Patch coverage is 81.81818% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.72%. Comparing base (b4ccef0) to head (8c8dc07).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
astroquery/utils/tap/core.py 71.42% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3438   +/-   ##
=======================================
  Coverage   70.72%   70.72%           
=======================================
  Files         232      232           
  Lines       20041    20045    +4     
=======================================
+ Hits        14174    14177    +3     
- Misses       5867     5868    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bsipocz bsipocz added this to the 0.4.12 milestone Oct 8, 2025
@jespinosaar
Copy link
Contributor

Great, thanks @jsaizsantos ! Please let us know if you have further comments, @bsipocz . We are preparing for an internal release at the end of this month, so it would be great if we could have this reviewed and merged by next week.

Copy link
Member

@bsipocz bsipocz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jsaizsantos for the PR and welcome to astroquery!

I have some comment for the content here, namely to consider not having the separate method just the new kwarg to get_datalinks. And maybe calling it something else then option, maybe extra_options (I'm not really sold on this idea) or something else that best describes it.

options=options,
verbose=verbose)

def get_datalinks_metadata(self, ids, *, linking_parameter='SOURCE_ID', verbose=False):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have this as a separate method rather than just documenting the one needs to have use options='METADATA'? The narrative documentation example below throw me off the track as starting with that one, and based on the method name I expected only metadata rather than it having the same result as using get_datalinks and some extra metadata.

Comment on lines 1431 to 1432
options : str, optional, default None
To let customize the server behaviour
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

options feels very generic; could we be more specific naming this?
Also, I would find it useful to mention what valid values could be for this, from the example below 'METADATA' is one, but how could the user know what else works?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition, adding a new kwarg is an API change, thus will need to be mentioned in the changelog

return user.startswith(f"{user_id}:") and user.count("\\n") == 0

def get_datalinks(self, ids, *, linking_parameter=None, verbose=False):
def get_datalinks(self, ids, *, linking_parameter=None, options=None, verbose=False):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need to be mentioned in the changelog

Copy link
Author

@jsaizsantos jsaizsantos Oct 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dear @bsipocz, thanks for your comments! I try to explain:

The best option for me, ideally, would have been to just add a new method without changing the signature of the parent get_datalinks. However, in order to reuse code and avoid copy-paste, I called the existing parent get_datalinks method from the new get_datalinks_metadata, and for getting the new behavior from the server, we needed a new argument to that method of the parent TapPlus class.

You say with good reason that this argument name is generic, and it is on purpose: the idea is that it could be reused in future cases to customize the behavior of the server (as there are several classes extending TapPlus, for different ESA archives, every one having their requirements) without needing to touch this get_datalinks method once and again, as it happened this time. The value of the options argument would tell the exact additional behavior.

I will tackle your suggestions:

  • Rename options to extra_options.
  • Indicate the only valid value for it right now, which is METADATA for the Euclid archive.
  • Mention the change of signature in the changelog.

@jsaizsantos
Copy link
Author

Dear @bsipocz:
I expect all your suggestions have been tackled.
Could you please re-check?

cc @esdc-esac-esa-int

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants